home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 1868 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: news.cc.ic.ac.uk!not-for-mail
  2. From: nagd@doc.ic.ac.uk (Nicholas d'Alterio)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Question!@#!
  5. Date: 17 Jan 1996 11:12:51 GMT
  6. Organization: Imperial College, London, UK
  7. Message-ID: <4diljj$36i@oban.cc.ic.ac.uk>
  8. References: <4dcejq$2un@venus.senecac.on.ca> <DLBGw1.CpA@news.cern.ch>
  9. NNTP-Posting-Host: oak48.doc.ic.ac.uk
  10. X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
  11.  
  12. Maurizio Loreti (loreti@mxsld2.pd.infn.it) wrote:
  13. : In article <4dcejq$2un@venus.senecac.on.ca>, you write:
  14. : >
  15. : >I have a very Simple question.. well, it should be simple for 'alot' of 
  16. : >you reading this newsgroup..
  17. : >
  18. : >anyways.
  19. : >
  20. : >I have created a program that asks THE users for his name, then writes it 
  21. : >to a file, the file is called name.txt..
  22. : >
  23. : >Evertime this program is executed, the file name.txt get's overwritten.
  24. : >
  25. : >How can i keep this file, name.txt, so that i can eventually have a 
  26. : >listing of all users who ran my program???
  27. : >
  28. : >Appreciated..
  29. : A simple solution is to switch to VAX/VMS.  A new 'name.txt' file will
  30. : have a different version number in its file system.
  31. : :-)
  32.  
  33. Or if you don't want to switch to an operating system from
  34. the dark ages you could open the file in append mode.
  35. e.g
  36.  
  37.     fptr = fopen( "name.txt", "a" );
  38.  
  39. That way new names are just added to the end of the file
  40. instead of a new file being created. If the file does
  41. not exist then it is created.
  42.  
  43. Nick
  44.  
  45. -- 
  46.  
  47. ~=====================================================~
  48.   Nicholas d'Alterio - Msc student Computing Science
  49.             Imperial College, London
  50.   E-Mail: nagd@ic.ac.uk or daltern@ic.ac.uk (closing)
  51.   http://crab.sp.ph.ic.ac.uk/~projects/nick_gid/nick/
  52. ~=====================================================~
  53.